import java.io.*;

public class Test02 {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        Singelton01 instance1 = Singelton01.getInstance();
        FileOutputStream fos = new FileOutputStream("F:\\code\\test.text");
        ObjectOutputStream oos = new ObjectOutputStream(fos);
        oos.writeObject(instance1);

        FileInputStream fis = new FileInputStream("F:\\code\\test.text");
        ObjectInputStream ois = new ObjectInputStream(fis);
        Singelton01 instance2 = (Singelton01) ois.readObject();
        System.out.println(instance1 == instance2);
    }
}
